import request from '@/utils/request'

const sysUserApi = {
  Index: '/sys-user/index',
  Save: '/sys-user/save',
  Disable: '/sys-user/disable',
  Enable: '/sys-user/enable'
}

/**
 * 加载用户数据
 * @returns {requestPromise}
 */
export function loadList (searchParams = {}) {
    return request({
        url: sysUserApi.Index,
        method: 'get',
        params: searchParams
    })
}
/**
 * 保存用户数据
 * @param postData
 * @returns {requestPromise}
 */
export function saveData (postData = {}) {
    return request({
        url: sysUserApi.Save,
        method: 'post',
        data: postData
    })
}

/**
 * 禁用用户
 * @param userId
 * @param status
 * @returns {requestPromise}
 */
export function disable (userIds) {
    return request({
        url: sysUserApi.Disable,
        method: 'post',
        data: { user_ids: userIds }
    })
}
/**
 * 激活用户
 * @param {*} userId
 * @param {*} status
 * @returns
 */
export function enable (userIds) {
  return request({
      url: sysUserApi.Enable,
      method: 'post',
      data: { user_ids: userIds }
  })
}
